<extend name="Common@Base/iframelayout"/>
<block name="body">
    <nav class="case-detail-top">
        <div class="container-fluid">
            <div class="row">
            <span class="btn-group selected-action" style="left: 45%;">
                <h3>信息更新</h3>
            </span>

            </div>
        </div>
    </nav>
    <div class="casedetail-content" style="background: #eee url(images/register-bg.jpg) center center no-repeat;">
        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-6" style="left: 25%;margin-top: 35px;">
                    <div class="panel panel-default">
                        <div class="tab-content">
                            <div class="tab-pane fade in active" id="debt-tel">
                                <form id="register_form" name="register_form" method="post" action="/home/index/doUpdate">
                                    <input type="hidden" name="id" value="{$user.id}">
                                    <div class="panel-body">
                                        <div class="row row-inside">
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                    <div class="col-sm-3 text-right vertical-middle_text">单位全称<span class="text-important">&nbsp;</span></div>
                                                    <div class="col-sm-9">
                                                        {$user.account}
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-12">

                                                <div class="form-group">
                                                    <div class="col-sm-3 text-right vertical-middle_text">单位属性<span class="text-important">&nbsp;</span></div>
                                                    <div class="dropdown col-sm-9 dropdown-block">
                                                        {$user.attribute|fc_get_config_value="USER_ATTRIBUTE"}
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-12">

                                                <div class="form-group">
                                                    <div class="col-sm-3 text-right vertical-middle_text">所属级别<span class="text-important">&nbsp;</span></div>
                                                    <div class="col-sm-9 dropdown dropdown-block">
                                                        {$user.rank|fc_get_config_value="TASK_RANK"}
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                    <div class="col-sm-3 text-right vertical-middle_text">联系人<span class="text-important">&nbsp;</span></div>
                                                    <div class="col-sm-9">
                                                        <input class="form-control" type="text" name="contact" value="{$user.user_info.contact}">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                    <div class="col-sm-3 text-right vertical-middle_text">联系电话<span class="text-important">&nbsp;</span></div>
                                                    <div class="col-sm-9">
                                                        <input class="form-control" type="text" name="contact_phone" value="{$user.user_info.contact_phone}">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                    <div class="col-sm-3 text-right vertical-middle_text">联系邮箱<span class="text-important">&nbsp;</span></div>
                                                    <div class="col-sm-9">
                                                        <input class="form-control" type="text" name="email" value="{$user.user_info.email}">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-12 ">
                                                <div style="text-align:center" class="vertical-middle_text">
                                                    (不修改密码请放空)
                                                </div>
                                            </div>
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                    <div class="col-sm-3 text-right vertical-middle_text">输入新密码<span class="text-important">&nbsp;</span></div>
                                                    <div class="col-sm-9">
                                                        <input class="form-control" type="password" id="password" name="password" value="">
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="col-sm-12">
                                                <div class="form-group">
                                                    <div class="col-sm-3 text-right vertical-middle_text">确认新密码<span class="text-important">&nbsp;</span></div>
                                                    <div class="col-sm-9">
                                                        <input class="form-control" type="password" name="repassword" value="">
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        <div class="form-group text-center">
                                            <button class="btn-full" type="submit">修 改</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                    <script src="/Public/Common/js/alertify/alertify.js"></script>
                    <script src="/Public/Common/js/echarts.js"></script>
                    <script src="/Public/Common/js/daterangepicker/moment.js"></script>
                    <script src="/Public/Common/js/daterangepicker/daterangepicker.js"></script>
                    <script src="/Public/Common/js/daterangepicker/daterangepicker_cn.js"></script>
                    <script src="/Public/Common/js/easyticker/jquery.easing.min.js"></script>
                    <script src="/Public/Common/js/easyticker/jquery.easy-ticker.js"></script>
                    <script src="/Public/Common/js/uploadify/jquery.uploadify.min.js"></script>
                    <script src="/Public/Common/js/bootstrap-treeview.js"></script>
                    <script src="/Public/Common/js/zc2017.js"></script>
                    <script src="/Public/Common/js/staff.tree.js"></script>

                    <script type="text/javascript">
                        $(document).ready(function () {
                            $("#register_form").validate({
                                submitHandler: function () {
                                    $.post($("#register_form").attr("action"), $("#register_form").serialize(), function (data) {
                                        if (data === "0") {
                                            alertify.alert("信息更新成功，请重新登入账号!", function () {
                                                location.href = '/home/index/login';
                                            });
                                        } else {
                                            alertify.alert(data);
                                        }
                                    }).error(function (msg, url, line) {
                                        alert(msg.responseText);
                                    });
                                },
                                ignore: "",
                                rules: {
                                    contact: {
                                        required: true
                                    },
                                    contact_phone: {
                                        required: true,
                                        isPhone: true
                                    },
                                    email: {
                                        required: true,
                                        email: true
                                    },
                                    repassword: {
                                        equalTo: "#password"
                                    }
                                },
                                messages: {
                                    account: {
                                        required: "请填写单位名称"
                                    },
                                    contact: {
                                        required: "请填写联系人"
                                    },
                                    phone: {
                                        required: "请填写联系电话",
                                        isPhone: "请填写正确的联系电话"
                                    },
                                    email: {
                                        required: "填写邮箱",
                                        email: "填写正确邮箱"
                                    },
                                    repassword: {
                                        equalTo: "密码和重复密码不一致"
                                    }
                                }
                            });

                        });

                    </script>
                </div>
            </div>
        </div>

    </div>
</block>